package leetcode.easy;

import leetcode.base.ListNode;

/**
 * ClassName: $876_MiddleListNode
 * Description:
 * date: 2021/9/13 12:32
 *
 * @author liyifan
 */
public class $876_MiddleListNode {
    public ListNode middleNode(ListNode head) {
        ListNode fast = head;
        ListNode slow = head;

        while (fast != null && fast.next != null) {
            fast = fast.next.next;
            slow = slow.next;
        }
        return slow;
    }
}
